# -*- coding: UTF-8 -*-
from . import app
from flask import request
from werkzeug.utils import secure_filename
from module_tool import *

# 上传文件
@app.route('/interface/tool/upload', methods=['GET', 'POST'])
def interface_tool_upload():
    if request.method == 'POST':
        f = request.files['file']
        fname = secure_filename(f.filename)
        uploaddir = module_tool_get_conf('software', 'uploaddir')
        f.save('%s%s' % (uploaddir, fname))
        return '%s%s' % (uploaddir, fname)